<?php

class CustomerPersons extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'customer_contact_persons':
	 * @var integer $customer_contact_persons_id
	 * @var integer $customer_contact_persons_customer_id
	 * @var string $customer_contact_persons_firstname
	 * @var string $customer_contact_persons_lastname
	 * @var string $customer_contact_persons_country_code
	 * @var string $customer_contact_persons_area_code
	 * @var string $customer_contact_persons_telephone
	 * @var string $customer_contact_persons_fax
	 * @var string $customer_contact_persons_mobile
	 * @var string $customer_contact_persons_email
	 * @var string $customer_contact_persons_created_at
	 * @var string $customer_contact_persons_changed_at
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'customer_contact_persons';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('customer_contact_persons_firstname, customer_contact_persons_lastname, customer_contact_persons_country_code, customer_contact_persons_telephone, customer_contact_persons_created_at, customer_contact_persons_changed_at', 'required'),
			array('customer_contact_persons_firstname, customer_contact_persons_lastname, customer_contact_persons_telephone, customer_contact_persons_fax, customer_contact_persons_mobile, customer_contact_persons_email', 'length', 'max'=>50),
			array('customer_contact_persons_country_code, customer_contact_persons_area_code', 'length', 'max'=>5),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'customer_contact_persons_customer' => array(self::BELONGS_TO, 'Customers', 'customer_contact_persons_customer_id'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'customer_contact_persons_id' => 'Customer Contact Persons',
			'customer_contact_persons_customer_id' => 'Customer Contact Persons Customer',
			'customer_contact_persons_firstname' => 'Customer Contact Persons Firstname',
			'customer_contact_persons_lastname' => 'Customer Contact Persons Lastname',
			'customer_contact_persons_country_code' => 'Customer Contact Persons Country Code',
			'customer_contact_persons_area_code' => 'Customer Contact Persons Area Code',
			'customer_contact_persons_telephone' => 'Customer Contact Persons Telephone',
			'customer_contact_persons_fax' => 'Customer Contact Persons Fax',
			'customer_contact_persons_mobile' => 'Customer Contact Persons Mobile',
			'customer_contact_persons_email' => 'Customer Contact Persons Email',
			'customer_contact_persons_created_at' => 'Customer Contact Persons Created At',
			'customer_contact_persons_changed_at' => 'Customer Contact Persons Changed At',
		);
	}
}